package com.scrcu.core.batch.constant;

/**
 * @Description: 批量调度静态常量
 * @Author: 刘超
 * @Date: 2023-05-08 20:52
 */
public class BatchConstants {

    /**
     * 执行类型-新跑
     */
    public static final short EXECUTION_TYPE_START = 0;

    /**
     * 执行类型-续跑
     */
    public static final short EXECUTION_TYPE_RESUME = 1;

    /**
     * 执行类型-重跑
     */
    public static final short EXECUTION_TYPE_REDO = 2;

    /**
     * 执行状态-初始状态，新创建，未分发，未入队
     */
    public static final short EXECUTION_STATUS_NEW = 0;

    /**
     * 执行状态-已在批量应用入队，等待执行
     */
    public static final short EXECUTION_STATUS_QUEUED = 1;

    /**
     * 执行状态-执行中
     */
    public static final short EXECUTION_STATUS_RUNNING = 2;

    /**
     * 执行状态-成功执行完毕
     */
    public static final short EXECUTION_STATUS_SUCCESS = 3;

    /**
     * 执行状态-执行失败
     */
    public static final short EXECUTION_STATUS_FAILED = 4;

    /**
     * 执行状态-已挂起
     */
    public static final short EXECUTION_STATUS_SUSPEND = 5;

    /**
     * 执行状态-正常中断中
     */
    public static final short EXECUTION_STATUS_STOPPING = 6;

    /**
     * 执行状态-正常中断
     */
    public static final short EXECUTION_STATUS_STOPPED = 7;

    /**
     * 执行状态-执行超时
     */
    public static final short EXECUTION_STATUS_TIMEOUT = 8;

    /**
     * 执行异常-异常-未找到
     */
    public static final int EXECUTION_ERROR_NOT_FOUND = 1;

    /**
     * 执行异常-状态异常
     */
    public static final int EXECUTION_ERROR_WRONG_STATUS = 2;

    /**
     * 执行异常-缺失关键信息
     */
    public static final int EXECUTION_ERROR_MISSING_INFO = 3;

    /**
     * 执行异常-未知异常
     */
    public static final int EXECUTION_ERROR_UNKNOWN = 4;

    /**
     * 调度状态-不允许
     */
    public static final short SCHEDULER_STATUS_DISABLE = 0;

    /**
     * 调度状态-允许
     */
    public static final short SCHEDULER_STATUS_ENABLE = 1;

    /**
     * 批量信息-遇异常后无动作，批量直接失败，消可能还在执行的其它动作
     */
    public static final short INFO_FAILABLE_STOP = 0;

    /**
     * 批量信息-忽略异常，只记录事件，不做处理（不中断父流程）
     */
    public static final short INFO_FAILABLE_IGNORE = 1;

    /**
     * 批量信息-遇异常后 续跑一次 当前批量，已成功的任务不再执行，失败的则会再跑一次
     */
    public static final short INFO_FAILABLE_RESUME = 2;

    /**
     * 批量信息-遇异常后 重跑一次（从头开始，跑成功的子任务也再跑一遍） 当前批量
     */
    public static final short INFO_FAILABLE_REDO = 3;

    /**
     * 批量信息-状态停用
     */
    public static final short INFO_STATUS_DISABLE = 0;

    /**
     * 批量信息-状态启用
     */
    public static final short INFO_STATUS_ENABLE = 1;

    /**
     * 批量信息- 0表示不冻结
     */
    public static final short INFO_FREEZE_NONE = 0;

    /**
     * 批量信息- -1表示永久冻结（前次执行必须完成且成功）
     */
    public static final short INFO_FREEZE_BLOCK = -1;

    /**
     * 状态停用
     */
    public static final short LOCK_STATUS_DISABLE = 0;
    /**
     * 状态启用
     */
    public static final short LOCK_STATUS_ENABLE = 1;
}
